package ink.carnation.imtalk.model.po;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;


import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Author flbu920
 * @Date 2020/9/20 15:56
 * @Version 1.0
 */

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "tb_user")
public class UserPo implements Serializable {

    @Id
    @GeneratedValue(generator = "JDBC")
    private Integer id;
    @NotNull(message = "用户名为空")
    private String nickname;
    @NotNull(message = "密码为空")
    @Length(min = 3,max = 16,message = "密码长度必须为3到16个字符")
    private String password;
    @Email(message = "Email格式非法")
    @NotNull(message = "邮箱为空")
    private String email;

    private Boolean valid;
}
